package cn.shangqizhenshuai.sqiot.mapper;

import cn.shangqizhenshuai.sqiot.entity.Equipment;
import cn.shangqizhenshuai.sqiot.entity.EquipmentExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface EquipmentMapper {
    long countByExample(EquipmentExample example);

    int deleteByExample(EquipmentExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Equipment record);

    int insertSelective(Equipment record);

    List<Equipment> selectByExample(EquipmentExample example);

    Equipment selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param( "record" ) Equipment record, @Param( "example" ) EquipmentExample example);

    int updateByExample(@Param( "record" ) Equipment record, @Param( "example" ) EquipmentExample example);

    int updateByPrimaryKeySelective(Equipment record);

    int updateByPrimaryKey(Equipment record);
    /**
     * 根据区域id查询所有的设备
     * @param aid
     * @return 在区域内所有的设备列表
     */
    List<Equipment> selectequipmentByaid(int aid);

    /**
     * 根据id 修改是否启用
     * @param id
     * @param flag
     * @return 修改成功的条数
     */
    int UpdatEpreameatByequipmentId(@Param("id") int id ,@Param("flag") int flag);

    /**
     * 根据 设备查询最新值
     * @param eids ，分割
     * @return
     */
    Map<Integer,Double> get_r_value(@Param("eids") String eids);
}